/*
 * testSeedTree.cc
 *
 *  Created on: Jun 5, 2013
 *      Author: hxin
 */

#include "SeedTree.h"
#include <string>
#include <cstdlib>

using namespace std;

int main(int argc, char * argv[]) {
	string refFileName;
	string hashFileName;
	int Threshold = 100;
	int MaxLv = 24;

	if (argc == 3) {
		refFileName = argv[1];
		hashFileName = argv[2];
	} else if (argc == 5) {
		refFileName = argv[1];
		hashFileName = argv[2];
		Threshold = atoi(argv[3]);
		MaxLv = atoi(argv[4]);
	} else {
		cerr
				<< "Usage: $> ./SeedTree RefFileName HashFileName (entryPrintThreshold)"
				<< endl;
		return 1;
	}
	SeedTree s;
	//s.genTreeFake();
	s.loadFiles(hashFileName, refFileName);
	s.loadChromo(0);
	s.genTree(Threshold, MaxLv + 1);
	//s.genTree(100, 500,"seedTree.txt");
	//s.genXml("/home/hxin/data/hashtable/gexf/");
	cout << "===Data without taking out Repeats===" << endl;
	//s.loadTree("seedTree.txt");
	//s.printRootNodes();
	s.analyse(0.7);
	s.printAnalysisData();
	s.evalHetSeed(MaxLv);
//	s.printRootNodes();
	s.printEvaluationData();
//
//	while (1) {
//		string rootSeed;
//		cout << "input rootseed" << endl;
//		cin >> rootSeed;
//		s.printRootBranch(rootSeed);
//	}
//	s.prunePartialRepeats(24);
//	s.evalRepeatCoverage();
//	s.printRepeatCoverage();
//	s.pruneGenuineRepeats(24);
//	s.checkRoots();
//
//	cout << "===Data after taking out Repeats===" << endl;
//	s.analyse(0.7);
//	s.printAnalysisData();
//	s.evalHetSeed();
//	s.evalRepeatCoverage();
//	s.printEvaluationData();
//	s.printData();
//	s.printLeafNodes();
//	s.prunePartialRepeats();
//	s.analyse(0.7);
//	s.printData();
//	s.printLeafNodes();

	return 0;
}
